<?php

namespace common\models\user;

use Yii;

/**
 * This is the model class for table "{{%user_favorite}}".
 *
 * @property int $id
 * @property int $user_id 用户ID
 * @property string $model 收藏模型ID
 * @property int $model_id 收藏内容ID
 * @property int $created_at 收藏时间
 * @property int $updated_at 更新时间
 */
class UserFavorite extends \common\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%user_favorite}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['user_id', 'model_id', 'created_at', 'updated_at'], 'integer'],
            [['model'], 'required'],
            [['model'], 'string', 'max' => 20],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => '用户ID',
            'model' => '收藏模型ID',
            'model_id' => '收藏内容ID',
            'created_at' => '收藏时间',
            'updated_at' => '更新时间',
        ];
    }

}
